// --------------------------------------------------------------------------------------------
// Version: MPL 1.1/GPL 2.0/LGPL 2.1
// 
// The contents of this file are subject to the Mozilla Public License Version
// 1.1 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
// http://www.mozilla.org/MPL/
// 
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
// for the specific language governing rights and limitations under the
// License.
// 
// <remarks>
// Generated by IDLImporter from file imgILoader.idl
// 
// You should use these interfaces when you access the COM objects defined in the mentioned
// IDL/IDH file.
// </remarks>
// --------------------------------------------------------------------------------------------
namespace Gecko
{
	using System;
	using System.Runtime.InteropServices;
	using System.Runtime.InteropServices.ComTypes;
	using System.Runtime.CompilerServices;
	
	
	/// <summary>
    /// imgILoader interface
    ///
    /// @author Stuart Parmenter <pavlov@netscape.com>
    /// @version 0.3
    /// @see imagelib2
    /// </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("e61377d2-910e-4c65-a64b-428d150e1fd1")]
	public interface imgILoader
	{
		
		/// <summary>
        /// Start the load and decode of an image.
        /// @param aURI the URI to load
        /// @param aInitialDocumentURI the URI that 'initiated' the load -- used for
        /// 3rd party cookie blocking
        /// @param aReferrerURI the 'referring' URI
        /// @param aReferrerPolicy the policy to apply to sending referrers.
        /// examples: "default", "never", "always", "origin"
        /// (see W3C referrer-policy spec for valid policy strings)
        /// @param aLoadingPrincipal the principal of the loading document
        /// @param aLoadGroup Loadgroup to put the image load into
        /// @param aObserver the observer (may be null)
        /// @param aCX some random data
        /// @param aLoadFlags Load flags for the request
        /// @param aCacheKey cache key to use for a load if the original
        /// image came from a request that had post data
        /// @param aContentPolicyType [optional] the nsContentPolicyType to
        /// use for this load. Defaults to
        /// nsIContentPolicy::TYPE_IMAGE
        /// ImageLib does NOT keep a strong ref to the observer; this prevents
        /// reference cycles.  This means that callers of loadImage should
        /// make sure to Cancel() the resulting request before the observer
        /// goes away.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		imgIRequest LoadImageXPCOM([MarshalAs(UnmanagedType.Interface)] nsIURI aURI, [MarshalAs(UnmanagedType.Interface)] nsIURI aInitialDocumentURL, [MarshalAs(UnmanagedType.Interface)] nsIURI aReferrerURI, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aReferrerPolicy, [MarshalAs(UnmanagedType.Interface)] nsIPrincipal aLoadingPrincipal, [MarshalAs(UnmanagedType.Interface)] nsILoadGroup aLoadGroup, imgINotificationObserver aObserver, [MarshalAs(UnmanagedType.Interface)] nsISupports aCX, uint aLoadFlags, [MarshalAs(UnmanagedType.Interface)] nsISupports cacheKey, System.IntPtr aContentPolicyType);
		
		/// <summary>
        /// Start the load and decode of an image.
        /// @param aChannel the channel to load the image from.  This must
        /// already be opened before ths method is called, and there
        /// must have been no OnDataAvailable calls for it yet.
        /// @param aObserver the observer (may be null)
        /// @param cx some random data
        /// @param aListener [out]
        /// A listener that you must send the channel's notifications and data
        /// to.  Can be null, in which case imagelib has found a cached image
        /// and is not interested in the data. @aChannel will be canceled for
        /// you in this case.
        ///
        /// ImageLib does NOT keep a strong ref to the observer; this prevents
        /// reference cycles.  This means that callers of loadImageWithChannel should
        /// make sure to Cancel() the resulting request before the observer goes away.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		imgIRequest LoadImageWithChannelXPCOM([MarshalAs(UnmanagedType.Interface)] nsIChannel aChannel, imgINotificationObserver aObserver, [MarshalAs(UnmanagedType.Interface)] nsISupports cx, [MarshalAs(UnmanagedType.Interface)] ref nsIStreamListener aListener);
	}
	
	/// <summary>imgILoaderConsts </summary>
	public class imgILoaderConsts
	{
		
		// <summary>
        // validation.
        // </summary>
		public const ulong LOAD_CORS_ANONYMOUS = 1<<16;
		
		// 
		public const ulong LOAD_CORS_USE_CREDENTIALS = 1<<17;
	}
}
